/*
 * @Description: 标题栏
 * @Author: ziwei.ma
 * @Date: 2019-08-02 17:23:10
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-08-02 18:29:03
 */
<template>
  <title-bar
    id="title-bar"
    :needBorder="true"
    :titleText="titleText"
  >
    <div
      slot="right"
      class="title-right"
      @click="jumpToTelephone"
      v-show="rightBtn"
    >联系客服
      <i class="icon iconfont icon-phone fontsize28"></i>
    </div>
  </title-bar>
</template>

<script>
import { TitleBar } from 'vue-xb-ui-depot'
export default {
  components: {
    'title-bar': TitleBar
  },
  data() {
    return {

    }
  },
  props: {
    titleText: String,
    rightBtn: Boolean
  },
  methods: {
    // 跳转至拨号页面
    jumpToTelephone() {
      let servicePhone = JSON.parse(localStorage.getItem('BCglobals')).PHONE
      window.location.assign('tel:' + servicePhone)
    }
  }
}
</script>

<style>
.title-bar-wrapper {
  z-index: 99;
  height: 98px;
  background-color: #fff;
}
.title-bar-wrapper > .title-text {
  color: #000000;
}
.title-right {
  position: absolute;
  font-size: 32px;
  right: 32px;
}
</style>
